<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Topics</title>
</head>
<body>
    {% extends "learning_logs/base.html" %}
    {% block content %}
        <p>Topics</p>
        <ul>
            {% for topic in topics %}
            <li>
                <!-- 正确的 URL 生成，传递正确的 topic.id -->
                <a href="{% url 'learning_logs:topic' topic.id %}">{{ topic }}</a>
            </li>
            {% empty %}
            <li>No topics have been added yet.</li>
            {% endfor %}
        </ul>
    {% endblock content %}
</body>
</html>